package com.coolingme.shallow;

import lombok.Data;

import java.util.List;

/**
 * 浅克隆
 *
 * @author wangyue
 * @date 2020/9/30 9:32
 */
@Data
public class ConcretePrototype implements Cloneable {

    private String name;

    private Integer age;

    private List<String> hobbies;

    @Override
    public ConcretePrototype clone() {
        try {
            return (ConcretePrototype) super.clone();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
